package com.itheima.pojo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 客户实体类
 * 
 * 今天的用的注解都来自这个包： javax.persistence
 * 
 */
@Entity //把一个类标记成实体类
@Table(name="cst_customer")  //映射表
public class Customer implements Serializable{

	@Id  //把一个普通属性标记为主键属性
	@Column(name="cust_id") //映射表的字段
	@GeneratedValue(strategy=GenerationType.IDENTITY) //       AUTO_INCREMENT   -- 主键策略： 数据库的自增长策略
	//@GeneratedValue(strategy=GenerationType.TABLE) //       适用于所有的数据库，但是性能不好
	//@GeneratedValue(strategy=GenerationType.AUTO) //       根据环境选择最优策略
	
	//删除@GeneratedValue注解：主键的值，必须自己给
    private Long custId;
	
	@Column(name="cust_name") //映射表的字段
    private String custName;
	
	@Column(name="cust_source") //映射表的字段
    private String custSource;
	
	@Column(name="cust_level") //映射表的字段
    private String custLevel;
	
	@Column(name="cust_industry") //映射表的字段
    private String custIndustry;
	
	@Column(name="cust_address") //映射表的字段
    private String custAddress;
	
	@Column(name="cust_phone") //映射表的字段
    private String custPhone;
    
    //省略get和set
	public Long getCustId() {
		return custId;
	}
	public void setCustId(Long custId) {
		this.custId = custId;
	}
	public String getCustName() {
		return custName;
	}
	public void setCustName(String custName) {
		this.custName = custName;
	}
	public String getCustSource() {
		return custSource;
	}
	public void setCustSource(String custSource) {
		this.custSource = custSource;
	}
	public String getCustLevel() {
		return custLevel;
	}
	public void setCustLevel(String custLevel) {
		this.custLevel = custLevel;
	}
	public String getCustIndustry() {
		return custIndustry;
	}
	public void setCustIndustry(String custIndustry) {
		this.custIndustry = custIndustry;
	}
	public String getCustAddress() {
		return custAddress;
	}
	public void setCustAddress(String custAddress) {
		this.custAddress = custAddress;
	}
	public String getCustPhone() {
		return custPhone;
	}
	public void setCustPhone(String custPhone) {
		this.custPhone = custPhone;
	}
	@Override
	public String toString() {
		return "Customer [custId=" + custId + ", custName=" + custName + ", custSource=" + custSource + ", custLevel="
				+ custLevel + ", custIndustry=" + custIndustry + ", custAddress=" + custAddress + ", custPhone="
				+ custPhone + "]";
	}
    
}